Properly handle d3dfs mouse capture and leave