Running SSH commands in threads