Add test case for #1028

See zeromq/libzmq#1028 for details.