appsrc: Fix deadlock that may occur when multiple threads access appsrc at once

https://bugzilla.gnome.org/show_bug.cgi?id=711550