A German court has kept former Catalan president Carles Puigdemont in custody pending possible extradition to Spain to face "rebellion" charges.