Method for getting next available port