Must quote detected $MAINCLASS since it may contain $
Revert compiledir permissions on script exit.

Otherwise it will remain world-writable infinately.
Avoid PHP notices.