Add union input test (issue #192)

This test is an adaption of issue #192.

I checked that it deadlocks without @StephanEwen's fix and succeeds with it.