Instead of messing with shiboken/sip to get a pointer to the main window in Maya, use this snippet (which is pretty obvious once you see it):
from PySide import QtGui
maya_window = None
for w in QtGui.QApplication.topLevelWidgets():
if w.objectName() == 'MayaWindow':
maya_window = w
Cheers,
Max