xdg-open: fix search_desktop_file's logic
It's only supposed to try other applications when the first one failed to start, but currently it continues searching even if an executable was found but exited with a non-zero status code. Also, the current approach waits for the program to exit, which is not consistent with how various DE's launching scripts work. This patch fixes both issues.
Both !13 (closed) and !31 (closed) try to solve the same issue (incorrectly). Should also fix #158 (closed).