Pennsylvania’s highest court ordered the rapper’s immediate release after he spent five months in jail