h264encode: fix thread lockup issue