Properly removes listener for $locationChangeSuccess when dialog is closed. Fixes #376