Justin Timberlake released from custody after appearing in court