A person who has custody of a petitioner entitled to a writ of habeas corpus and who, with intent to elude the service of the writ or to avoid its effect, (1) transfers the petitioner to the custody or places the petitioner under the power or control of another person, (2) conceals the petitioner, or (3) changes the place of confinement, shall forfeit $400 to the petitioner, recoverable in a civil action.