osx: Fix missing dock menu with qt5

Qt5 Removed the qt_mac_set_dock_menu function and left no replacement. It was
later re-added and deprecated for backwards-compatibility.

Qt5.2 adds the non-deprecated QMenu::setAsDockMenu(). Use that when possible.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: c21c74b